package Code;

import java.util.Arrays;
import java.util.Random;

/**
 * @author zihao
 * @date 2025/3/18 20:16
 * @VERSION
 * @description
 **/
public class Student {
    public Integer sNO;
    public String sName;
    public String sSex;
    public Integer sAge;
    public int sJava;

    //行为
    //输出学生信息
    public void show(){

    }
    //计算成绩平均值
    public void avg(){

    }
    //计算最大值和最小值
    public void max(){

    }
    public void min(){

    }


    //构造方法
    //无参构造
    public Student() {
    }
    //满参构造
    public Student(Integer sNO, String sName, String sSex, Integer sAge, int sJava) {
        this.sNO = sNO;
        this.sName = sName;
        this.sSex = sSex;
        this.sAge = sAge;
        this.sJava = sJava;
    }

    //getter and setter

    public Integer getsNO() {
        return sNO;
    }

    public void setsNO(Integer sNO) {
        this.sNO = sNO;
    }

    public String getsName() {
        return sName;
    }

    public void setsName(String sName) {
        this.sName = sName;
    }

    public String getsSex() {
        return sSex;
    }

    public void setsSex(String sSex) {
        this.sSex = sSex;
    }

    public Integer getsAge() {
        return sAge;
    }

    public void setsAge(Integer sAge) {
        this.sAge = sAge;
    }

    public int getsJava() {
        return sJava;
    }

    public void setsJava(int sJava) {
        this.sJava=sJava;
    }
    @Override
    public String toString() {
        return "Student{" +
                "学号=" + sNO +
                ", 姓名='" + sName + '\'' +
                ", 性别='" + sSex + '\'' +
                ", 年龄=" + sAge +
                ", 成绩=" + sAge +
                 '\'' +
                '}';
    }

    public static void main(String[] args) {
        Random random=new Random();
        Student stu=new Student();
        Student[] students=new Student[5];
        for (int i = 0; i < students.length; i++) {
            stu.setsNO(random.nextInt(100));
            stu.setsName("张"+i);
            if (i%2==0){
                stu.setsSex("男");
            }else{
                stu.setsSex("女");
            }
            stu.setsAge(random.nextInt(20));
            stu.setsJava(random.nextInt(100));
            students[i]=new Student (stu.getsNO(), stu.getsName(),
                    stu.getsSex(), stu.getsAge(),
                    stu.getsJava());
            System.out.println(Arrays.deepToString(students));
        }
    }
}
